export const state = () => ({
    draftPost: []
});

export const mutations = {
    // 新增文章
    addDraft(state, data) {
        state.draftPost.unshift(data);
        if (state.draftPost.length > 10) {
            state.historyList.length = 10;
        }
    },

    // 删除文章
    delDraft(state, id) {
        state.draftPost.splice(id, 1);
    }
};